package ebcs.database.service;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import ebcs.database.bean.BsNeedInfor;
import ebcs.database.bean.BsNeedInforData;
import ebcs.database.bean.BsNeedTime;
import ebcs.database.bean.BsUserInfor;
import ebcs.database.bean.BsUserNeedRel;
import ebcs.database.bean.RpUserReportBean;
import ebcs.database.bean.RpUserTaskNeedBean;
public interface BsUserNeedServiceImp
{ 
 	//保存登记信息
	public boolean regUserNeedRel(BsUserNeedRel userNeed);
	//查询用户报工情况
	public List<RpUserReportBean> searchUserNeedInfor(RpUserReportBean reportConditon);
 	//查询用户历史报工数据
	public List<RpUserReportBean> searchUserHistoryNeedInfor(RpUserReportBean reportConditon);
	//需求进度实时统计
	public List<RpUserReportBean> selectReportCount(RpUserReportBean reportConditon);
 
	//查询用户正在处理任务单
	public List<RpUserTaskNeedBean> selectTaskNeedList(RpUserTaskNeedBean condition);
	
	//查询用户没有处理任务单
	public List<RpUserTaskNeedBean> selectNoTaskNeedList(RpUserTaskNeedBean condition);
	//查询用户报工所有时间长
	public int selectUserTaskTime(RpUserTaskNeedBean condition);
	//删除报工信息
    public int deleteUserNeedInfor(String rouid);
    //新增需求
    public int addNeedInfor(BsNeedInfor record);
    //查询项目组中需求编号和项目组信息
    public List<BsNeedInfor>  selectNeedInforByNeedNoAndTeamNo(BsNeedInfor record);
    //查询领取其他项目组任务功能
    public List<RpUserTaskNeedBean> selectTaskNeedListByTeamNo(RpUserTaskNeedBean condition);
    //查询团队所有项目组任务
	public List<RpUserTaskNeedBean> selectTaskNeedListByGroupNo(RpUserTaskNeedBean condition);
	//更新需求信息
	public int updateNeedInforById(BsNeedInfor need);
	//更新已报工的需求编号
	public int updateNeedNoRelByNeedId(BsNeedInfor bean);
	
	//查询项目组下所有需求
	public List<BsNeedInfor> selectNeedInforList(BsNeedInfor need);
	public List<BsNeedInfor> selectNeedInfor(BsNeedInfor need);
	public List<BsNeedInfor> selectNeedInforDetail(BsNeedInfor need);
	//查下报工时间轴信息
	
	public List<BsNeedTime> selectNeedTimeList(BsUserInfor user);

    //修改最新的一条报工记录为关闭任务
	public int closeUserNeedRel(String rouid);
	public int reStartUserNeedRel(String rouid);
	//根据团队编号查询所有未通过审核的需求
    List<BsNeedInfor> selectNoPassNeedByRouid(String rouid);
    //根据rouid更新state字段
    int updateStateByRouid(@Param("rouid") String rouid,@Param("state") String state);
    
    List<BsNeedInforData> selectByBsNeedInforData(@Param("record")BsNeedInforData bsNeedInforData);
    int insertNeedInforData(List<BsNeedInforData> list);
    int updateNeedInforDataByNeedNo(BsNeedInforData bsNeedInforData);
    //清空表记录  再把最新抓取的数据填入
    int deleteNeedInforData();
	public BsUserInfor getProTeamNo(String userNo);
	public void updateNeedInfor(BsNeedInfor needInfor);
	public boolean deleteInfor(String needId);
	public List<BsUserNeedRel> selectByNeedId(String needId);
	// 项目经理审核报工
	public List<RpUserReportBean> seachReviewJob(RpUserReportBean reportConditon);
	//更新审核状态
	public void updateReportStateByRouId(BsUserNeedRel bsUserNeedRel);


    
}
